package myapp.CTL;

import java.util.ArrayList;

import myapp.DAO.UserDAO;
import myapp.DTO.UserDTO;

public class UserCTL {
	private UserDAO webSv;
	
	public UserCTL(){
		webSv = new UserDAO();
	}
	
	public String getMyName(String email, String pwd){
		return webSv.getMyName(email, pwd);
	}
	
	public ArrayList<UserDTO> getAllFriends(String userEmail, String pwd){
		return webSv.getAllFriends(userEmail, pwd);
	}
	
	public ArrayList<UserDTO> getOnlineFriends(String email, String pwd){
		return webSv.getOnlineFriends(email, pwd);
	}
	
	public ArrayList<UserDTO> getAllRequesters(String email, String pwd){
		return webSv.getAllRequesters(email, pwd);
	}
	
	public Boolean sendFriendRequest(String yourEmail, String yourFriendEmail){
		return webSv.sendFriendRequest(yourEmail, yourFriendEmail);
	}
	
	public void sendAcceptFriendRequest(String receiverEmail, String requesterEmail){
		webSv.sendAcceptFriendRequest(receiverEmail, requesterEmail);
	}
	
	public void sendRejectFriendRequest(String receiverEmail, String requesterEmail){
		webSv.sendRejectFriendRequest(receiverEmail, requesterEmail);
	}
	
	public String sendAddNewUserRequest(String userEmail, String name, String pwd){
		return webSv.sendAddNewFriendRequest(userEmail, name, pwd);
	}
	
	public String sendRemoveFriendShipRequest(String userEmail, String friendEmail){
		return webSv.sendRemoveFriendshipRequest(userEmail, friendEmail);
	}
	
	public void UpdateUser(UserDTO info){
		webSv.updateUser(info);
	}
}
